﻿<%@ WebHandler Language="C#" Class="getImage" %>

using System;
using System.Web;
using OneShoppingModel;
using OneShoppingBLL;
using System.Collections.Generic;
using OneShoppingUtility;
using System.Web.SessionState;

public class getImage : IHttpHandler, IRequiresSessionState
{

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        String imagePath = "";
        SystemUser user = (SystemUser)context.Session["user"];
        GeneralUser g = GeneralUserBLL.GetInstance().GetEntity(r => r.UserId == user.UserId);
        if (g != null)
        {
            if (g.HeadImage != null || g.HeadImage == "")
            {
                imagePath = g.HeadImage;
            }
        }

        context.Response.Write(UtilityJson.ResultToJson(imagePath));
    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }

}
